import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'Layout',
    component: () => import(/* webpackChunkName: "about" */ '../views/Layout.vue'),
    children: [{
      path: '/',
      component: () => import(/* webpackChunkName: "about" */ '../views/Index.vue')
    }, {
      path: 'list',
      component: () => import(/* webpackChunkName: "about" */ '../views/House-List/index.vue')
    }, {
      path: 'news',
      component: () => import(/* webpackChunkName: "about" */ '../views/News.vue')
    }, {
      path: 'profile',
      component: () => import(/* webpackChunkName: "about" */ '../views/Profile.vue')
    }]
  },
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/map',
    component: () => import('../views/Map.vue')
  },
  {
    path: '/citylist',
    component: () => import('../views/City-List.vue')
  },
  {
    path: '/search',
    component: () => import('../views/Search.vue')
  }, {
    path: '/house/detail/:id',
    component: () => import('../views/House-Detail.vue')
  },
  {
    path: '/user/login',
    component: () => import('../views/Login.vue'),
  },
  {
    path: '/rent',
    component: () => import('../views/Rent.vue'),
  },
  {
    path: '/rent/add',
    component: () => import('../views/AddRent.vue'),
  },
  {
    path: '/rent/search',
    component: () => import('../views/Rent-Search.vue'),
  }
]

const router = new VueRouter({
  routes
})

export default router
